<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>动态绑定不适用的情况——外部样式</title>
    <style>
        .bg {
            background-color: chocolate;
        }

        .line {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="app">
    <h1 class="bg line">Hello, Vue!</h1>
    <!--将外部样式写到 setup 中不生效。-->
    <!--运行后的结果如下：-->
    <!--<h1 class="background-color: chocolate">Hello, Vue!</h1>-->
    <h1 v-bind:class="bg">Hello, Vue!</h1>

    <!--可以将变量的设置为 选择器名称 字面量-->
    <h1 v-bind:class="background">Hello, Vue!</h1>

</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let bg = "background-color: chocolate"
                let line = "text-decoration: underline"

                let background = "bg"
                return {
                    bg, line, background
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>